// 连接数据库集合
var mongoose = require('mongoose')
var DB_URL = 'mongodb://localhost:27017/printing'

mongoose.connect(DB_URL,{ useNewUrlParser:true,useUnifiedTopology:true})

mongoose.connection.on('connected',()=>{
    console.log('print数据库连接成功!')
})

mongoose.connection.on('disconnected',()=>{
    console.log('print 数据库连接失败')
})

mongoose.connection.on('error',()=>{
    console.log('print数据库连接错误')
})

module.exports = mongoose